package org.streets.eis.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;

@Entity(name="EIS_ORGAN")
public class Organization implements Serializable {
	private static final long serialVersionUID = 1L;
	
	@Id
	private String id;
	@Column(name="parent_id")
	private String parentId;
	@Column
	private String name;
	@Column
	private String levelCode;
	@Column
	private String attr;
	@Column
	private Integer showIndex;

	/*
	@NestedFetch(
			value="select * from EIS_UNIT where parent_id = :id",
			type=Orgnization.class)
			
	private List<Orgnization> childs; 
	
	public List<Orgnization> getChilds() {
		return childs;
	}

	public void setChilds(List<Orgnization> childs) {
		this.childs = childs;
	}
	
	
	@NestedFetch(
		value="select * from EIS_UNIT where id = :parentId"			
	)			
	private Orgnization parent;
	
	public Orgnization() {
		
	}
	
	public Orgnization getParent() {
		return parent;
	}
	
	public void setParent(Orgnization parent) {
		this.parent = parent;
	}

	 */
	
	public String getId() {
		return id;
	}
	
	public void setId(String id) {
		this.id = id;
	}
	
	public String getParentId() {
		return parentId;
	}
	
	public void setParentId(String parentId) {
		this.parentId = parentId;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getLevelCode() {
		return levelCode;
	}
	
	public void setLevelCode(String levelCode) {
		this.levelCode = levelCode;
	}
	
	public String getAttr() {
		return attr;
	}
	
	public void setAttr(String attr) {
		this.attr = attr;
	}

	public Integer getShowIndex() {
		return showIndex;
	}

	public void setShowIndex(Integer showIndex) {
		this.showIndex = showIndex;
	}	
	
	@Override
	public String toString(){
		return this.name;
	}
}
